/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.muni.fi.pa165.musiclibrary.api.dao;

import cz.muni.fi.pa165.musiclibrary.api.entities.Album;
import java.util.List;

/**
 * This service allows to manipulate with albums.
 * 
 * @author xmacejov
 */
public interface AlbumDAO {
     /**
     * Stores new album into database. Id for the new album is automatically
     * generated and stored into id attribute.
     * 
     * @param album album to be created.
     * @throws IllegalArgumentException when album is null or album is without name.
     * @throws IllegalEntityException when album has already assigned id.
     */       
    public void createAlbum(Album album);
 
     /**
     * Returns album with given id.
     * 
     * @param id primary key of requested album.
     * @return album with given id or null if album does not exist.
     * @throws IllegalArgumentException when given id is null.
     */    
    public Album getAlbum(Long id);
    
    /**
     * Returns list of all albums in the database.
     * 
     * @return list of all albums in database.
     */
    public List<Album> getAllAlbums();
    
      /**
     * Updates album in database.
     * 
     * @param album updated album to be stored into database.
     * @throws IllegalArgumentException when album is null, has null id or album without name.
     * @throws IllegalEntityException when album does not exist in the database.
     */      
    public void updateAlbum(Album album);

     /**
     * Deletes album from database. 
     * 
     * @param album album to be deleted from db.
     * @throws IllegalArgumentException when album is null, album has null id or album does not exist in the database.
     * @throws IllegalEntityException when album does not exist in the database.
     */   
    public void deleteAlbum(Album album);   
}
